home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic Toolbox / Visual Basic Toolbox (P.I.E.)(1996).ISO / database / randomfa / aboutdlg.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-12-29  |  19.7 KB  |  577 lines

  1. VERSION 2.00
  2. Begin Form frmAbout 
  3.    BackColor       =   &H00C0C0C0&
  4.    BorderStyle     =   3  'Fixed Double
  5.    Caption         =   "About Current Program"
  6.    ClientHeight    =   5205
  7.    ClientLeft      =   2310
  8.    ClientTop       =   2010
  9.    ClientWidth     =   6135
  10.    FontBold        =   -1  'True
  11.    FontItalic      =   0   'False
  12.    FontName        =   "System"
  13.    FontSize        =   9.75
  14.    FontStrikethru  =   0   'False
  15.    FontUnderline   =   0   'False
  16.    Height          =   5610
  17.    Icon            =   0
  18.    Left            =   2250
  19.    LinkMode        =   1  'Source
  20.    LinkTopic       =   "Form2"
  21.    MaxButton       =   0   'False
  22.    MinButton       =   0   'False
  23.    ScaleHeight     =   5205
  24.    ScaleWidth      =   6135
  25.    Top             =   1665
  26.    Width           =   6255
  27.    Begin PictureBox picSquare 
  28.       BackColor       =   &H00FFFFFF&
  29.       FontBold        =   -1  'True
  30.       FontItalic      =   0   'False
  31.       FontName        =   "Times New Roman"
  32.       FontSize        =   24
  33.       FontStrikethru  =   0   'False
  34.       FontUnderline   =   0   'False
  35.       ForeColor       =   &H00FF0000&
  36.       Height          =   2865
  37.       Left            =   240
  38.       ScaleHeight     =   2835
  39.       ScaleWidth      =   5640
  40.       TabIndex        =   5
  41.       Top             =   2250
  42.       Width           =   5670
  43.    End
  44.    Begin Timer tmrControl 
  45.       Interval        =   1
  46.       Left            =   360
  47.       Top             =   1590
  48.    End
  49.    Begin CommandButton cmdOK 
  50.       Caption         =   "OK"
  51.       Height          =   645
  52.       Left            =   4560
  53.       TabIndex        =   2
  54.       Top             =   1530
  55.       Width           =   1335
  56.    End
  57.    Begin Label lblGratus 
  58.       Alignment       =   2  'Center
  59.       BackColor       =   &H00C0C0C0&
  60.       Caption         =   "Supplied with the compliments of:"
  61.       FontBold        =   -1  'True
  62.       FontItalic      =   0   'False
  63.       FontName        =   "MS Sans Serif"
  64.       FontSize        =   13.5
  65.       FontStrikethru  =   0   'False
  66.       FontUnderline   =   0   'False
  67.       ForeColor       =   &H000000FF&
  68.       Height          =   390
  69.       Left            =   720
  70.       TabIndex        =   7
  71.       Top             =   30
  72.       Width           =   4725
  73.    End
  74.    Begin Image imgUKFlag 
  75.       Height          =   480
  76.       Left            =   5580
  77.       Picture         =   ABOUTDLG.FRX:0000
  78.       Top             =   360
  79.       Width           =   480
  80.    End
  81.    Begin Line Line1 
  82.       BorderWidth     =   2
  83.       X1              =   510
  84.       X2              =   5400
  85.       Y1              =   1470
  86.       Y2              =   1470
  87.    End
  88.    Begin Label lblMsg2 
  89.       Alignment       =   2  'Center
  90.       BackColor       =   &H00C0C0C0&
  91.       Caption         =   "Fax 0181 364 5296 - Email 100037.37@compuserve.com"
  92.       ForeColor       =   &H000000FF&
  93.       Height          =   240
  94.       Left            =   510
  95.       TabIndex        =   6
  96.       Top             =   1230
  97.       Width           =   4950
  98.    End
  99.    Begin Image imgScrolls 
  100.       Height          =   480
  101.       Left            =   90
  102.       Picture         =   ABOUTDLG.FRX:0302
  103.       Top             =   390
  104.       Width           =   480
  105.    End
  106.    Begin Line linLine1 
  107.       BorderWidth     =   2
  108.       X1              =   735
  109.       X2              =   5265
  110.       Y1              =   1140
  111.       Y2              =   1140
  112.    End
  113.    Begin Label lblDDC 
  114.       BackColor       =   &H00C0C0C0&
  115.       Caption         =   "DataCraft Development Company"
  116.       FontBold        =   -1  'True
  117.       FontItalic      =   0   'False
  118.       FontName        =   "MS Sans Serif"
  119.       FontSize        =   13.5
  120.       FontStrikethru  =   0   'False
  121.       FontUnderline   =   0   'False
  122.       ForeColor       =   &H00FF0000&
  123.       Height          =   390
  124.       Left            =   735
  125.       TabIndex        =   1
  126.       Top             =   390
  127.       Width           =   4725
  128.    End
  129.    Begin Label lblMsg1 
  130.       BackColor       =   &H00C0C0C0&
  131.       Caption         =   "Windows System Development Consultants"
  132.       FontBold        =   -1  'True
  133.       FontItalic      =   0   'False
  134.       FontName        =   "MS Sans Serif"
  135.       FontSize        =   9.75
  136.       FontStrikethru  =   0   'False
  137.       FontUnderline   =   0   'False
  138.       ForeColor       =   &H00FF00FF&
  139.       Height          =   240
  140.       Left            =   795
  141.       TabIndex        =   3
  142.       Top             =   840
  143.       Width           =   4485
  144.    End
  145.    Begin Label Lbl_Info 
  146.       BackColor       =   &H00C0C0C0&
  147.       ForeColor       =   &H000000FF&
  148.       Height          =   600
  149.       Left            =   1005
  150.       TabIndex        =   4
  151.       Top             =   1560
  152.       Width           =   1875
  153.    End
  154.    Begin Label Lbl_InfoValues 
  155.       BackColor       =   &H00C0C0C0&
  156.       ForeColor       =   &H000000FF&
  157.       Height          =   600
  158.       Left            =   2910
  159.       TabIndex        =   0
  160.       Top             =   1560
  161.       Width           =   1410
  162.    End
  163. Option Explicit
  164. DefInt A-Z
  165. Const APP_TITLE = "Random Access Files"
  166. Const MF_BYPOSITION = &H400
  167. Declare Function GetSystemMenu Lib "User" (ByVal hWnd, ByVal bRevert)
  168. Declare Function RemoveMenu Lib "User" (ByVal hMenu, ByVal nPosition, ByVal wFlags)
  169. Declare Function GetWinFlags Lib "Kernel" () As Long
  170. Declare Function GetFreeSpace Lib "Kernel" (ByVal wFlags) As Long
  171. Const WF_STANDARD = &H10
  172. Const WF_ENHANCED = &H20
  173. Const WF_80x87 = &H400
  174. Dim findProcess     As Integer
  175. Dim fintWidth       As Integer
  176. Dim fintHeight      As Integer
  177. Dim fintPrintX      As Integer
  178. Dim fintPrintY      As Integer
  179. Sub cmdOK_Click ()
  180.     findProcess = False
  181.     DoEvents
  182. End Sub
  183. Sub cmdRunScreenSaver ()
  184.     On Error GoTo DazzleRunError
  185.     Dim intResult   As Integer
  186.     intResult = Shell(App.Path & "\dazzle.exe -b -w")
  187. DazzleRunExit:
  188.     Exit Sub
  189. DazzleRunError:
  190.     MsgBox "Error while running dazzle.exe:" & Chr$(13) & Error$, 48, "Error Running dazzle.exe"
  191.     Resume DazzleRunExit:
  192. End Sub
  193. Sub DrawAllLines ()
  194.     Dim sngStartX       As Single
  195.     Dim sngStartY       As Single
  196.     Dim sngEndX         As Single
  197.     Dim sngEndY         As Single
  198.     Dim intLoop         As Integer
  199.     Dim sngStartLoop    As Single
  200.     Dim sngEndLoop      As Single
  201.     Dim intStep         As Single
  202.     Dim intCount        As Integer
  203.     For intCount = 1 To 2
  204.         For intLoop = 1 To 4
  205.             Select Case intLoop
  206.                 Case 1          'BL to TR
  207.                     GoSub SetupBox
  208.                     sngStartX = 0
  209.                     sngEndX = fintWidth
  210.                     sngStartY = fintHeight
  211.                     sngEndY = 0
  212.                     sngStartLoop = sngStartX
  213.                     sngEndLoop = sngEndX
  214.                     intStep = 4
  215.                     GoSub XLeg
  216.                     sngStartX = 0
  217.                     sngEndX = fintWidth
  218.                     sngStartY = fintHeight
  219.                     sngEndY = 0
  220.                     sngStartLoop = 0
  221.                     sngEndLoop = fintHeight
  222.                     intStep = 4
  223.                     GoSub YLeg
  224.                 
  225.                 Case 2          'TL to BR
  226.                     GoSub SetupBox
  227.                     sngStartX = 0
  228.                     sngEndX = fintWidth
  229.                     sngStartY = 0
  230.                     sngEndY = fintHeight
  231.                     sngStartLoop = sngStartY
  232.                     sngEndLoop = sngEndY
  233.                     intStep = 4
  234.                     GoSub YLeg
  235.                     
  236.                     sngStartX = 0
  237.                     sngEndX = fintWidth
  238.                     sngStartY = 0
  239.                     sngEndY = fintHeight
  240.                     sngStartLoop = sngEndX
  241.                     sngEndLoop = sngStartX
  242.                     intStep = -4
  243.                     GoSub XLeg
  244.                 Case 3          'TR to BL
  245.                     GoSub SetupBox
  246.                     sngStartX = fintWidth
  247.                     sngEndX = 0
  248.                     sngStartY = 0
  249.                     sngEndY = fintHeight
  250.                     sngStartLoop = sngStartX
  251.                     sngEndLoop = sngEndX
  252.                     intStep = -4
  253.                     GoSub XLeg
  254.                     
  255.                     sngStartX = fintWidth
  256.                     sngEndX = 0
  257.                     sngStartY = 0
  258.                     sngEndY = fintHeight
  259.                     sngStartLoop = sngEndY
  260.                     sngEndLoop = sngStartY
  261.                     intStep = -4
  262.                     GoSub YLeg
  263.                     
  264.                 Case 4          'BR to TL
  265.                     GoSub SetupBox
  266.                     sngStartX = fintWidth
  267.                     sngEndX = 0
  268.                     sngStartY = fintHeight
  269.                     sngEndY = 0
  270.                     sngStartLoop = sngStartY
  271.                     sngEndLoop = sngEndY
  272.                     intStep = -4
  273.                     GoSub YLeg
  274.                     
  275.                     sngStartX = fintWidth
  276.                     sngEndX = 0
  277.                     sngStartY = fintHeight
  278.                     sngEndY = 0
  279.                     sngStartLoop = 0
  280.                     sngEndLoop = fintWidth
  281.                     intStep = 4
  282.                     GoSub XLeg
  283.             End Select
  284.         Next intLoop
  285.     Next intCount
  286.     Exit Sub
  287. SetupBox:
  288.     If findProcess = True Then
  289.         picSquare.Cls
  290.         PrintMessage APP_TITLE, RGB(0, 0, 255)
  291.     End If
  292.     Return
  293. XLeg:
  294.     If findProcess = True Then
  295.         For sngStartLoop = sngStartLoop To sngEndLoop Step intStep
  296.             If findProcess = True Then
  297.                 sngEndX = sngStartLoop
  298.                 picSquare.Line (sngStartX, sngStartY)-(sngEndX, sngEndY), RGB(Rnd * 256, Rnd * 256, Rnd * 256)
  299.                 DoEvents
  300.             Else
  301.                 Exit For
  302.             End If
  303.         Next sngStartLoop
  304.     End If
  305.     Return
  306. YLeg:
  307.     If findProcess = True Then
  308.         For sngStartLoop = sngStartLoop To sngEndLoop Step intStep
  309.             If findProcess = True Then
  310.                 sngEndY = sngStartLoop
  311.                 picSquare.Line (sngStartX, sngStartY)-(sngEndX, sngEndY), RGB(Rnd * 256, Rnd * 256, Rnd * 256)
  312.                 DoEvents
  313.             Else
  314.                 Exit For
  315.             End If
  316.         Next sngStartLoop
  317.     End If
  318.     Return
  319. End Sub
  320. Sub DrawCircles ()
  321.     Static intCount     As Integer
  322.     Dim intRepeat       As Integer
  323.     Dim intLoop         As Integer
  324.     Dim intStep         As Integer
  325.     Dim sngRadius       As Single
  326.     Dim sngCurrentX     As Single
  327.     Dim sngCurrentY     As Single
  328.     Dim lngColour       As Long
  329.     Dim lngStoreColour  As Long
  330.     intStep = 10
  331.     ' Position center of circles in form center
  332.     'sngRadius = ((fintHeight + fintWidth) / 2)
  333.     sngRadius = fintWidth / 1.75
  334.     sngCurrentX = picSquare.ScaleWidth / 2
  335.     sngCurrentY = picSquare.ScaleHeight / 2
  336.     picSquare.Cls
  337.     lngStoreColour = picSquare.ForeColor
  338.     If intCount > 6 Then intCount = 0
  339.     lngColour = QBColor(intCount)
  340.     PrintMessage "DataCraft Development", lngColour
  341.     For intLoop = 1 To sngRadius Step intStep
  342.         If findProcess = True Then
  343.             picSquare.Circle (sngCurrentX, sngCurrentY), intLoop, RGB(Rnd * 255, Rnd * 255, Rnd * 255)
  344.             PrintMessage "DataCraft Development", lngColour
  345.             DoEvents
  346.         Else
  347.             Exit For
  348.         End If
  349.     Next intLoop
  350.             
  351.     For intLoop = sngRadius To 1 Step -intStep
  352.         If findProcess = True Then
  353.             picSquare.Circle (sngCurrentX, sngCurrentY), intLoop, RGB(Rnd * 255, Rnd * 255, Rnd * 255)
  354.             PrintMessage "DataCraft Development", lngColour
  355.             DoEvents
  356.         Else
  357.             Exit For
  358.         End If
  359.     Next intLoop
  360.     intCount = intCount + 1
  361.     picSquare.ForeColor = lngStoreColour
  362. End Sub
  363. Sub DrawDownBars ()
  364.     Dim sngStartX       As Single
  365.     Dim sngStartY       As Single
  366.     Dim sngEndX         As Single
  367.     Dim sngEndY         As Single
  368.     picSquare.Cls
  369.     PrintMessage APP_TITLE, RGB(0, 0, 255)
  370.     sngStartX = 0
  371.     sngEndX = fintWidth
  372.     For sngStartY = 0 To fintHeight Step 2
  373.         If findProcess = True Then
  374.             sngEndY = sngStartY
  375.             picSquare.Line (sngStartX, sngStartY)-(sngEndX, sngEndY), RGB(Rnd * 256, Rnd * 256, Rnd * 256)
  376.             PrintMessage APP_TITLE, RGB(0, 0, 255)
  377.             DoEvents
  378.         Else
  379.             Exit For
  380.         End If
  381.     Next sngStartY
  382. End Sub
  383. Sub DrawLRLines ()
  384.     Dim sngStartX       As Single
  385.     Dim sngStartY       As Single
  386.     Dim sngEndX         As Single
  387.     Dim sngEndY         As Single
  388.     picSquare.Cls
  389.     PrintMessage APP_TITLE, RGB(0, 0, 255)
  390.     sngEndX = 0
  391.     sngEndY = fintHeight
  392.     sngStartY = 0
  393.     For sngStartX = 0 To fintWidth Step 4
  394.         If findProcess = True Then
  395.             picSquare.Line (sngStartX, sngStartY)-(sngEndX, sngEndY), RGB(Rnd * 256, Rnd * 256, Rnd * 256)
  396.             DoEvents
  397.         Else
  398.             Exit For
  399.         End If
  400.     Next sngStartX
  401.     sngStartX = fintWidth
  402.     For sngStartY = 0 To fintHeight Step 4
  403.         If findProcess = True Then
  404.             picSquare.Line (sngStartX, sngStartY)-(sngEndX, sngEndY), RGB(Rnd * 256, Rnd * 256, Rnd * 256)
  405.             DoEvents
  406.         Else
  407.             Exit For
  408.         End If
  409.     Next sngStartY
  410. End Sub
  411. Sub DrawRLLines ()
  412.     Dim sngStartX       As Single
  413.     Dim sngStartY       As Single
  414.     Dim sngEndX         As Single
  415.     Dim sngEndY         As Single
  416.     picSquare.Cls
  417.     PrintMessage APP_TITLE, RGB(0, 0, 255)
  418.     sngEndX = fintWidth
  419.     sngEndY = fintHeight
  420.     sngStartX = 0
  421.     For sngStartY = fintHeight To 0 Step -4
  422.         If findProcess = True Then
  423.             picSquare.Line (sngStartX, sngStartY)-(sngEndX, sngEndY), RGB(Rnd * 256, Rnd * 256, Rnd * 256)
  424.             DoEvents
  425.         Else
  426.             Exit For
  427.         End If
  428.     Next sngStartY
  429.     sngStartY = 0
  430.     For sngStartX = 0 To fintWidth Step 4
  431.         If findProcess = True Then
  432.             picSquare.Line (sngStartX, sngStartY)-(sngEndX, sngEndY), RGB(Rnd * 256, Rnd * 256, Rnd * 256)
  433.             DoEvents
  434.         Else
  435.             Exit For
  436.         End If
  437.     Next sngStartX
  438. End Sub
  439. Sub DrawSquares ()
  440.     ' Declare local variables
  441.     Dim intLoop     As Integer
  442.     Dim intStep     As Integer
  443.     Dim intMin      As Integer
  444.     Dim intMax      As Integer
  445.     Dim varUpper    As Variant
  446.     Dim varLower    As Variant
  447.     Dim varTemp     As Variant
  448.     Dim lngPosX     As Long
  449.     Dim lngPosY     As Long
  450.     intStep = 2
  451.     intMin = 10
  452.     intMax = 2000
  453.     DrawWidth = 1
  454.     ' Position center of Rectangle in Object center
  455.     lngPosX = (picSquare.ScaleWidth / 2)
  456.     lngPosY = (picSquare.ScaleHeight / 2)
  457.     'Start a loop to radiate outwards
  458.     For intLoop = intMin To intMax Step intStep
  459.         If findProcess = True Then
  460.             varTemp = intLoop / intMax
  461.             varUpper = 1 - varTemp: varLower = 1 + varTemp
  462.             picSquare.Line (lngPosX * varUpper, lngPosY * varUpper)-(lngPosX * varLower, lngPosY * varLower), RGB(Rnd * 255, Rnd * 255, Rnd * 255), B
  463.             DoEvents
  464.         Else
  465.             Exit For
  466.         End If
  467.     Next intLoop
  468.     'DoEvents
  469.     'Start a loop to radiate inwards
  470.     For intLoop = intMax To intMin Step -intStep
  471.         If findProcess = True Then
  472.             varTemp = intLoop / intMax
  473.             varUpper = 1 - varTemp: varLower = 1 + varTemp
  474.             picSquare.Line (lngPosX * varUpper, lngPosY * varUpper)-(lngPosX * varLower, lngPosY * varLower), RGB(Rnd * 255, Rnd * 255, Rnd * 255), B
  475.             DoEvents
  476.         Else
  477.             Exit For
  478.         End If
  479.     Next intLoop
  480.     DoEvents    'Release resources to windows
  481. End Sub
  482. Sub DrawUpBars ()
  483.     Dim sngStartX       As Single
  484.     Dim sngStartY       As Single
  485.     Dim sngEndX         As Single
  486.     Dim sngEndY         As Single
  487.     picSquare.Cls
  488.     PrintMessage APP_TITLE, RGB(0, 0, 255)
  489.     sngStartX = 0
  490.     sngEndX = fintWidth
  491.     For sngStartY = fintHeight To 0 Step -2
  492.         If findProcess = True Then
  493.             sngEndY = sngStartY
  494.             picSquare.Line (sngStartX, sngStartY)-(sngEndX, sngEndY), RGB(Rnd * 256, Rnd * 256, Rnd * 256)
  495.             PrintMessage APP_TITLE, RGB(0, 0, 255)
  496.             DoEvents
  497.         Else
  498.             Exit For
  499.         End If
  500.     Next sngStartY
  501. End Sub
  502. Sub Form_Load ()
  503.     ' Center the AboutBox on the screen
  504.     Me.Move ((Screen.Width - Me.Width) / 2), ((Screen.Height - Me.Height) / 2)
  505.     Dim WinFlags        As Long
  506.     Dim Mode            As String
  507.     Dim Processor       As String
  508.     Dim strTitle        As String
  509.     strTitle = "About " & App.Title
  510.     frmAbout.Caption = strTitle
  511.     ' Dialog Boxes should only have Move and Close items
  512.     ' in their System menus', so remove the others.
  513.     Remove_Items_From_Sysmenu frmAbout
  514.     ' Get current Windows configuration
  515.     WinFlags = GetWinFlags()
  516.     ' Display configuration values in Lbl_Info.Caption and Lbl_InfoValues.Caption
  517.     ' (NOTE: CRLF variable causes a line break in a labels caption)
  518.     If WinFlags And WF_ENHANCED Then Mode = "386 Enhanced Mode" Else Mode = "Standard Mode"
  519.     Lbl_Info.Caption = Mode + Chr$(13) + Chr$(10) + "Free Memory:" + Chr$(13) + Chr$(10) + "Math Co-processor:"
  520.     If WinFlags And WF_80x87 Then Processor = "Present" Else Processor = "None"
  521.     Lbl_InfoValues.Caption = Chr$(13) + Chr$(10) + Format$(GetFreeSpace(0) \ 1024) + " KB" + Chr$(13) + Chr$(10) + Processor
  522.     fintWidth = picSquare.ScaleWidth
  523.     fintHeight = picSquare.ScaleHeight
  524.     findProcess = True
  525. End Sub
  526. Sub Form_Paint ()
  527.     Screen.MousePointer = 0
  528. End Sub
  529. Sub PrintMessage (TheMsg As String, TheColour As Long)
  530.     picSquare.ForeColor = TheColour
  531.     fintPrintX = (fintWidth - picSquare.TextWidth(TheMsg)) / 2
  532.     fintPrintY = (fintHeight - picSquare.TextHeight(TheMsg)) / 2
  533.     picSquare.CurrentX = fintPrintX
  534.     picSquare.CurrentY = fintPrintY
  535.     picSquare.Print TheMsg
  536. End Sub
  537. Sub Remove_Items_From_Sysmenu (A_Form As Form)
  538.     Dim intMenuHandle        As Integer
  539.     Dim intResult            As Integer
  540.     ' Modal dialog boxes usually do not have a System menu or if
  541.     ' they do, they consist of only MOVE and CLOSE options.  This
  542.     ' routine is called when a Modal dialog box is about to be
  543.     ' displayed, to remove all but the MOVE and CLOSE options
  544.     ' from the forms system menu.
  545.     ' Obtain the handle to the forms System menu
  546.     intMenuHandle = GetSystemMenu(A_Form.hWnd, 0)
  547.     ' Remove all but the MOVE and CLOSE options.  The menu items
  548.     ' must be removed starting with the last menu item to prevent
  549.     ' the menu items from taking on new position values as other
  550.     ' menu items are being removed.
  551.     intResult = RemoveMenu(intMenuHandle, 8, MF_BYPOSITION) 'Switch to
  552.     intResult = RemoveMenu(intMenuHandle, 7, MF_BYPOSITION) 'Separator
  553.     intResult = RemoveMenu(intMenuHandle, 5, MF_BYPOSITION) 'Separator
  554.     intResult = RemoveMenu(intMenuHandle, 4, MF_BYPOSITION) 'Maximize
  555.     intResult = RemoveMenu(intMenuHandle, 3, MF_BYPOSITION) 'Minimize
  556.     intResult = RemoveMenu(intMenuHandle, 2, MF_BYPOSITION) 'Size
  557.     intResult = RemoveMenu(intMenuHandle, 0, MF_BYPOSITION) 'Restore
  558. End Sub
  559. Sub tmrControl_Timer ()
  560.     While findProcess = True
  561.         DrawCircles
  562.         DrawSquares
  563.         DrawLRLines
  564.         DrawCircles
  565.         DrawSquares
  566.         DrawDownBars
  567.         DrawCircles
  568.         DrawSquares
  569.         DrawRLLines
  570.         DrawCircles
  571.         DrawSquares
  572.         DrawUpBars
  573.         DrawAllLines
  574.     Wend
  575.     Unload Me
  576. End Sub
  577.